/**
 * Created by abdulazizalonizi on 7/16/17.
 */
import java.util.Scanner ;

public class Task2 {
    public static void main (String [] args)
    {
        Scanner kb = new Scanner(System.in);

        System.out.println("enter 3 or more words");
        String s1 = kb.nextLine();

        int firstWord = s1.indexOf(' ');
       // System.out.println(firstWord);

        int lastWord = s1.lastIndexOf(' ');
        //System.out.println(lastWord);

       String s2 = s1.substring(firstWord+1 , lastWord);
       System.out.println(s2);





    }
}
